home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
btsys.arc
/
BTREAD.C
< prev
next >
Wrap
Text File
|
1984-12-14
|
567b
|
28 lines
/* btread */
#include <stdio.h>
#include <btextern.h>
int btread (filhand, recno)
/* read routine for btree system */
int filhand, recno;
{
long offset;
int i;
char *cp;
/* seek to correct byte in file */
offset = recno * LBLEN;
if (( i = fseek (btfilar[filhand].fdesc, offset, 0)) == -1)
BTSETCOD (filhand, recno, 3); /* bad file seek */
cp = (char *)btfilar[filhand].filbuf;
if (!(i = fread (cp, 1, LBLEN, btfilar[filhand].fdesc)))
BTSETCOD (filhand, recno, 1); /* bad file read */
return (0);
}
/* end of btread */